﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using webapp4U;

public partial class Usercontrol_ControlMultiMenu : System.Web.UI.UserControl
{
    ClassExecute.ClassExecute dt;
    string error = "";
    string str = webapp4U.Configuration.CurrentConnectionString;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserName"] != null)
        {
            lbtnLogout.Visible = true;
            lbtnLogin.Visible = false;
        }
        else
        {
            lbtnLogin.Visible = true;
            lbtnLogout.Visible = false;
        }
        loadcategory();
    }
    private void loadcategory()
    {
        dt = new ClassExecute.ClassExecute();

        DataTable menuRoot = dt.Get_Data_DataTable(str, ref error, "k_getMenuDirectSale1", CommandType.StoredProcedure,
            new SqlParameter("@TypeID",Session["TypeID"].ToString()));
        rpt_category.DataSource = menuRoot;
        rpt_category.DataBind();
    }
    protected void lbtnLogout_Click(object sender, EventArgs e)
    {
        Session.Abandon();
        Response.Redirect(Globals.ApplicationPath + "Default.aspx?Homepage=");
    }
}